package edu.ycu.aladdin.web.controller;

import edu.ycu.aladdin.web.config.oauth.BaiduOauthConfig;
import edu.ycu.aladdin.web.config.oauth.GithubOauthConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author <a href="mailto:wangruihuano@gmail.com">王瑞环</a>
 * @since 1.0
 */
@Controller
@RequestMapping("/oauth/redirect")
public class Guid2OauthController {

    private static final String REDIRECT = "redirect:";

    @Autowired BaiduOauthConfig baiduOauthConfig;
    @Autowired GithubOauthConfig githubOauthConfig;

    @RequestMapping("/baidu")
    public String redirect2Baidu(){
        return REDIRECT+baiduOauthConfig.getGuid_url();
    }

    @RequestMapping("/github")
    public String redirect2Github(){
        return REDIRECT + githubOauthConfig.getGuid_url();
    }

    // TODO 其他三方平台引导授权
}
